package com.neusoft.nepm.controller;

import com.neusoft.nepm.dto.MessageDto;
import com.neusoft.nepm.service.IMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/messages")
public class MessageController {

    @Autowired
    private IMessageService messageService;

    @PostMapping("/send")
    public boolean sendMessage(@RequestBody MessageDto message) {
        return messageService.sendMessage(message);
    }
}